/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package amd.core.search;

import amd.database.ConnectDB;
import amd.database.DbDocumentSimilarity;
import amd.database.QueryNoResultException;
import java.util.ArrayList;

/**
 *
 * @author Latifah Dwi Nurachma
 */
public class SearchDocSimilar {
    public static ArrayList<ArrayList<String>> search(ConnectDB conn, String strDocReff) throws QueryNoResultException{
        ArrayList<ArrayList<String>> listDoc = new ArrayList<ArrayList<String>>();
        listDoc = DbDocumentSimilarity.getDocumentSimilar(conn, strDocReff);
        return listDoc;
    }

    public static ArrayList<ArrayList<String>> search(ConnectDB conn, String strDocReff,float treshold,int page) throws QueryNoResultException{
        int limit = 10;
        ArrayList<ArrayList<String>> listDoc = new ArrayList<ArrayList<String>>();
        listDoc = DbDocumentSimilarity.getDocumentSimilar(conn, strDocReff, treshold,((limit*page)+1), limit);
        return listDoc;
    }
}
